package com.hyacinth.cloudnote.common.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.UUID;

/**
 * 基础抽象DTO类
 */
@NoArgsConstructor
@Setter
@Getter
public abstract class AbstractPersistableDTO extends AbstractDTO {

    private static final long serialVersionUID = 7585073747125024017L;

    /**
     * ID
     */
    @ApiModelProperty(value = "ID")
    @JsonProperty(index = 0)
    private UUID id;

    @JsonIgnore
    public boolean isNew() {
        return this.id == null;
    }
}
